<template>
  <v-container
    fill-height
    fluid
    grid-list-xl
  >

    <v-layout justify-center wrap>
      <v-flex>
        <material-card
          color="green">
          <v-form>
            <v-container py-0>
              <v-layout wrap>
                <!-- 币种 -->
                <v-flex xs12 sm6 md4 lg2 d-flex >
                    <v-select
                      v-model="symbolActive"
                      :items="symbol"
                      label="币种"
                    ></v-select>
                </v-flex>
                <!-- 合约类型 -->
                <v-flex xs12 sm6 md4 lg2 d-flex >
                    <v-select
                      v-model="contractTypeActive"
                      :items="contractType"
                      label="合约类型"
                    ></v-select>
                </v-flex>
                <!-- 时间周期 -->
                <v-flex xs12 sm6 md4 lg2 d-flex >
                  <v-text-field label="时间周期(分钟)" v-model="period"></v-text-field>
                </v-flex>
                <!-- 最大均线值，默认60 -->
                <v-flex xs12 sm6 md4 lg2 d-flex >
                  <v-text-field label="最大均线值" v-model="maxMA"></v-text-field>
                </v-flex>
                <!-- 上涨因子 -->
                <v-flex xs12 sm6 md4 lg2 d-flex >
                  <v-text-field label="上涨因子" v-model="upperLeadFactor"></v-text-field>
                </v-flex>
                <!-- 涨幅因子 -->
                <v-flex xs12 sm6 md4 lg2 d-flex >
                  <v-text-field label="涨幅因子" v-model="gainFactor"></v-text-field>
                </v-flex>
                <!-- 购买方式 -->
                <v-flex xs12 sm6 md4 lg2 d-flex >
                    <v-select
                      v-model="buyTypeActive"
                      :items="buyType"
                      label="购买方式"
                    ></v-select>
                </v-flex>

                 <!-- 保护因子 -->
                <v-flex xs12 sm6 md4 lg2 d-flex >
                  <v-text-field label="保护因子" v-model="protectionDownFactor"></v-text-field>
                </v-flex>
                <!-- 查询按钮 -->
                <v-flex xs12 sm3 md2 lg1 d-flex >
                   <v-btn small
                    :loading="btnLoading"
                    :disabled="btnLoading"
                    color="info"
                    class="inquire-btn"
                    @click="inquire"
                  >
                    查 询
                    <v-icon right dark></v-icon>
                  </v-btn>
                   <!-- <v-btn color="info" small>查 询</v-btn> -->
                </v-flex>

              </v-layout>
            </v-container>
          </v-form>
        </material-card>
      </v-flex>
    </v-layout>
  </v-container>
</template>

<script>
import { twoMaStrategyBest } from '@/api/demoAddress'

export default {
  data () {
    return {
      // 币种
      symbolActive:'BTC',
      symbol:['BTC','EOS'],
      // 合约类型
      contractTypeActive:'quarter',
      contractType:['quarter'],
      // 时间周期 /分钟
      period:15,
      // 最大均线值，默认60
      maxMA:60,
      // 上涨因子
      upperLeadFactor:2,
      //涨幅因子 
      gainFactor:0.0043,
      // 购买方式：0-等额，1-复利
      buyTypeActive:'等额',
      buyType:['等额','复利'],
      // 保护因子
      protectionDownFactor:0.005,
      // 加载
      btnLoading: true

    }
  },
  mounted(){
    this.inquire()
  },
  methods: {
    inquire(){
        twoMaStrategyBest('symbol=BTC' +
                    '&contractType=quarter' +
                    '&period=15min' +
                    '&maxMA=6' +
                    '&upperLeadFactor=2' +
                    '&gainFactor=0.0043' +
                    '&buyType=0' +
                    '&protectionDownFactor=0.005').then( res =>{
              this.btnLoading = false
        }).catch(e=>{
          this.btnLoading = false
        })
    },
  }
}
</script>
